
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.ArrayList, tournoi.modele.Tournoi"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html class="no-js">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Liste des tournois</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <style>
            body {
                padding-top: 50px;
                padding-bottom: 20px;
            }
        </style>
        <link rel="stylesheet" href="css/bootstrap-theme.min.css">
        <link rel="stylesheet" href="css/main.css">

        <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>
    <body>
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="index">Gestion de Tournoi</a>
        </div>
        <div class="navbar-collapse collapse">
			<ul class="nav navbar-nav">
				<li><a href="index">Accueil</a></li>
				<li class="active"><a href="index?action=listeTournois">Tournois</a></li>
				<li><a href="index?action=listeEquipes">Equipes</a></li>
				<li><a href="index?action=listeArbitres">Arbitres</a></li>
				<li><a href="admin">Admin menu</a></li>
			</ul>
        </div><!--/.navbar-collapse -->
      </div>
    </div>
	<!-- ******************** -->
	<!-- ******************** -->
	<!-- CODE INTERESSANT ICI -->
	<!-- ******************** -->
	<!-- ******************** -->     
	<div class="container">
		<h3>Liste des tournois</h3>
		<hr>
		<% 	ArrayList<Tournoi> lt = (ArrayList<Tournoi>) request.getAttribute("tournois"); 
			if(lt != null && !lt.isEmpty()) { %>
		<table class="table table-hover">
            <tr>
                <th>#</th><th>Nom du tournoi</th><th>Nombre d'équipes</th><th>etat</th><th>gagnant</th>
            </tr>

			<%	for(Tournoi t : lt) { %>
		
			<tr>
                <td>
                  <a href="index?action=voirTournoi&id=<%=t.getIdTournoi() %>" class="btn btn-default btn-xs">
  					<span class="glyphicon glyphicon-zoom-in"></span>
				</a>
				</td>
				<td><%=t.getNomTournoi() %></td>
				<td><%=t.getLesEquipes().size() %></td>
				<td><%=t.etat() %></td>
				<td><%=t.gagnant() %></td>
            </tr>
            <%	} %>
		</table>
		<%	} else { %>
			<p>Pas de tournoi pour le moment !</p>
		<% 	} %>
	<!-- ************************ -->
	<!-- ************************ -->
	<!-- FIN CODE INTERESSANT ICI -->
	<!-- ************************ -->
	<!-- ************************ -->   
		<hr>
		<footer>
		  	<p class="text-muted credit">&copy; Benoît Boyer, Antoine Leguy & Pierre-Antoine Milot 2013</p>
		</footer>
    </div> <!-- /container -->        
    	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script>

        <script src="js/vendor/bootstrap.min.js"></script>

        <script src="js/main.js"></script>
        <script type="text/javascript">
        </script>
    </body>
</html>
